---
title: bud.lazy
description: Enable or disable lazy compilation.
tags:
  - configuration
  - facade
---

Configure lazy compilation settings.

In development bud.js compiles imports (not entrypoints) lazily.

## Usage

Enable lazy compilation.

```ts title=bud.config.ts
bud.lazy()
```

```ts title=bud.config.ts
bud.lazy(true)
```

Disable lazy compilation.

```ts title=bud.config.ts
bud.lazy(false)
```

## Custom configuration

For more information see [webpack's documentation on `experiments.lazyCompilation`](https://webpack.js.org/configuration/experiments/#experimentslazycompilation).

```ts title=bud.config.ts
bud.lazy({
  // disable lazy compilation for dynamic imports
  imports: false,

  // disable lazy compilation for entries
  entries: false,

  // do not lazily compile moduleB
  test: module => !/moduleB/.test(module.nameForCondition()),
})
```
